package net.starwifi.duobao.jms.utils;

/*
 * <Info>
 *
 * @copyright   Copyright 2013-2013 武汉�?源智能系统有限公�? (http://www.kyzny.com)
 * @author      MeiSha <albertruo@gmail.com>
 * @version     <ID>1.0.3</ID>
 */

import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;

import java.lang.reflect.Type;
import java.util.Date;

public class UtilDateDeserializer implements JsonDeserializer<Date> {

    public Date deserialize(JsonElement json, Type typeOfT,
                            JsonDeserializationContext context) throws JsonParseException {
        return  new  Date(json.getAsJsonPrimitive().getAsLong());
    }

}